import { httpGet, httpPost, httpOtherGet } from "@/utils/request";
//获取商品列表
export function fetchListGoods(data) {
  return httpGet({
    url: "/organization/user/goods/listGoods",
    data: data,
  });
}

//获取商品详情
export function fetchGoodsDetail(data) {
  return httpGet({
    url: "/organization/user/goods/getGoodsDetail",
    data: data,
  });
}

export function fetchViewGoods(data) {
  return httpPost({
    url: "/organization/user/goods/viewGoods",
    data: data,
  });
}

//h5和小程序首页
export function fetchWebIndex(data) {
  return httpGet({
    url: "/organization/user/index/webIndex",
    data: data,
  });
}

//获取购买的商品详情
export function fetchUserBuyGoodsDetail(data) {
  return httpGet({
    url: "/organization/user/goods/getUserBuyGoodsDetail",
    data: data,
  });
}

//解析阿里点播
export function fetchVideoPlayAuth(data) {
  return httpGet({
    url: "/common/vod/getVideoPlayAuth",
    data: data,
  });
}

export function fetchVideoUrl(data) {
  return httpOtherGet({
    url: "https://api.aliyuncs.com",
    data: data,
  });
}

//获取直播带货商品
export function fetchUserGoodsCommerce(data) {
  return httpGet({
    url: "/organization/goods/commerce/listUserGoodsCommerce",
    data: data,
  });
}

//判断用户是否被拉黑
export function fakeInBlackList(data) {
  return httpPost({
    url: "/organization/goods/checkInBlackList",
    data: data,
  });
}

//获取分享信息
export async function fetchShareInfo(data) {
  return httpGet({
    url: "/organization/share/getShareInfo",
    data: data,
  });
}

//获取分享信息
export async function fetchListUserInvite(data) {
  return httpGet({
    url: "/organization/goods/listUserInvite",
    data: data,
  });
}
//检查用户是否能抽奖
export async function fetchLotteryQualification(data) {
  return httpGet({
    url: "/organization/user/goods/checkUserLotteryQualification",
    data: data,
  });
}

//查看中奖用户数量
export async function fetchPrizeUserForUser(data) {
  return httpGet({
    url: "/organization/goods/lottery/listGoodsLotteryPrizeUserForUser",
    data: data,
  });
}

//获取表单详情
export async function fetchInformationCollectionDetail(data) {
  return httpGet({
    url: "/organization/marketing/informationCollection/getInformationCollectionDetail",
    data: data,
  });
}

//提交表单
export async function fakeSaveUserInformation(data) {
  return httpPost({
    url: "/organization/marketing/informationCollection/saveUserInformationCollection",
    data: data,
  });
}

export const fetchShareParamInfo = (data = {}) => {
  return httpGet({
    url: "/organization/share/getShareParam",
    data: data,
  });
};
//获取解密分享码

//兑换码领取
export async function fakeAuthCodePlay(data) {
  return httpPost({
    url: "/organization/user/goods/authCodePlay",
    data: data,
  });
}


//用户端获取页面配置详情
export const fetchPageConfigDetailForUser = (data = {}) => {
  return httpGet({
    url: "/organization/pageConfig/getPageConfigDetailForUser",
    data: data,
  });
};

//查询机构列表
export const fetchListOrganization = (data = {}) => {
  return httpGet({
    url: "/organization/user/organization/listOrganization",
    data: data,
  });
};



////获取客户地址
export const fetchListUserAddress = (data = {}) => {
  return httpGet({
    url: "/organization/user/address/listUserAddress",
    data: data,
  });
};

//保存客户地址
export async function fakeSaveUserAddress(data) {
  return httpPost({
    url: "/organization/user/address/saveUserAddress",
    data: data,
  });
}


//设置默认
export async function fakeSetDefault(data) {
  return httpPost({
    url: "/organization/user/address/setDefault",
    data: data,
  });
}

//预约秒杀
export async function fakeUserReserve(data) {
  return httpPost({
    url: "/organization/goods/userReserve",
    data: data,
  });
}


////获取秒杀列表
export const fetchListGoodsSecKillForUse = (data = {}) => {
  return httpGet({
    url: "/organization/goods/listGoodsSecKillForUser",
    data: data,
  });
};


////根据id获取秒杀列表
export const fetchListGoodsSecKillByIds = (data = {}) => {
  return httpGet({
    url: "/organization/goods/listGoodsSecKillByIds",
    data: data,
  });
};

////根据id获取商品列表
export const fetchListGoodsByIds = (data = {}) => {
  return httpGet({
    url: "/organization/user/goods/listGoodsByIds",
    data: data,
  });
};

////根据id获取商品列表
export const fetchCheckMiniProgramUpdate = (data = {}) => {
  return httpGet({
    url: "/common/version/checkMiniProgramUpdate",
    data: data,
  });
};
